Device applied to scaling factor of horizontal scan of a scanner and method thereof

ABSTRACT

The present invention relates to a device applied to scaling factor of horizontal scan of a scanner and a method thereof. The present invention lets signals be processed by a multiplexer, a shifter, and an adder to achieve the above function, or lets signals be processed by a plurality of shifters and a plurality of adders to achieve the above function. Because a divider or a ROM occupying a too large area in the prior art is not required, the present invention can effectively reduce the occupied area, increase the scanning speed, and enhance the image quality of a scanner.

FIELD OF THE INVENTION

[0001] The present invention relates to a device applied to scaling factor of horizontal scan of a scanner and a method thereof. The present invention can reduce the occupied area, increase the scanning speed, and enhance the image quality of the scanner.

BACKGROUND OF THE INVENTION

[0002] In the realm of scanner, the scaling function is usually utilized. For instance, when a scanner having a resolution of 1200 dots per inch (dpi) is used to scan a picture having a resolution of 400 dpi, the scaling factor thereof is ⅓. Mutual coordination in the horizontal and vertical directions is required for the above scaling. If the scaling factor is ⅓, the scaling in the horizontal direction needs to be ⅓, and the scaling in the vertical direction also needs to be ⅓. There are two kinds of manufacturing methods for the scaling in the horizontal direction, one being pixel-abstraction method, the other being pixel-average method. In the pixel-abstraction method, when a scanner scans a horizontal line, only one pixel is taken out from adjacent pixels to represent these n pixels. This method has the disadvantages of discontinuity and inferior image quality. In the pixel-average method, when a scanner scans a horizontal line, the average value of n adjacent pixels is used to represent these n pixels. This method can obtain better image quality, and has no disadvantage of discontinuity. Therefore, the pixel-average method is usually used as the manufacturing method for the scaling in the horizontal direction.

[0003] The commonly used scaling factors in the horizontal direction of a scanner are ⅔, ½, ⅓, ¼, ⅙, ⅛, {fraction (1/12)}, and so on. The above scaling factors are all combinations of 2, ½ and ⅓. That is, their functions can be achieved using combinations of (2, ½, ⅓). For instance, when the scaling factor is ⅙, ½ can first be done, and then ⅓; or ⅓ can first be done, and then ½.

[0004] During the average process, 2 or ½ can easily be achieved by left-shifting 1 bit (2) or right-shifting 1 bit (½) the added result of pixels. However, the manufacturing of ⅓ is much more difficult. There are two commonly used methods. One is dividing the added result of pixels by 3 using a divider. This method has the disadvantages of occupying a too large area (mainly because the divider occupies a too large area) and a too slow scanning speed due to a slower processing speed of the divider.

[0005] The other commonly used method is achieving the function of dividing by 3 through referring to a table. Although this method has a faster processing speed, a read only memory (ROM) thereof will occupy a very large area. With a 16-bit scanner as an example, there will be 16×2¹⁶ decoders and 16×2¹⁶ encoders. The more the number of bits, the faster the area increases. Therefore, this method also has the disadvantage of occupying a too large area.

[0006] Accordingly, the present invention aims to propose a device applied to scaling factor of horizontal scan of a scanner and a method thereof, whereby a simpler method can be used to manufacture scaling factor of horizontal scan of a scanner, and the area occupied by the device can be effectively decreased.

SUMMARY OF THE INVENTION

[0007] The primary object of the present invention is to provide a device applied to scaling factor of horizontal scan of a scanner and a method thereof, wherein a multiplexer, controllable shifters, and adders are used to achieve this function, hence resolving the problem of occupying a too large area in the prior art.

[0008] The secondary object of the present invention is to provide a device applied to scaling factor of horizontal scan of a scanner and a method thereof, whereby when the latency is (log₂n−1) clocks, the value of n is at least 2′ more than the number of bits of the scanner (i is an integer). If a pipeline architecture is matched, the scanning speed can be increased and the image quality can be enhanced.

[0009] The various objects and advantages of the present invention will be more readily understood from the following detailed description when read in conjunction with the appended drawing, in which:

BRIEF DESCRIPTION OF THE DRAWINGS

[0010]FIG. 1 is a block diagram of a preferred embodiment of the present invention;

[0011]FIG. 2 is a flowchart of a preferred embodiment of the present invention;

[0012]FIG. 3 is a block diagram of another preferred embodiment of the present invention; and

[0013]FIG. 4 is a flowchart of another preferred embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014]FIG. 1 shows a block diagram of a preferred embodiment of the present invention. In this embodiment, a digital signal is transferred to a multiplexer (MUX) 12 via an input signal 10. The multiplexer 12 is a 2-to-1 and n-bit multiplexer. The multiplexer 12 is respectively connected to a controllable shifter 14 and an adder 16 via conducting wires. The above controllable shifter 14 is a controllable shifter capable of adjusting different shifting bits according to the numbers of bits and clocks. The controllable shifter 14 is then respectively connected to the adder 16 and an output signal 145 via conducting wires. Finally, the adder 16 is connected to the multiplexer 12 via conducting wires to be used as one input of the multiplexer 12. The above preferred embodiment applies to input signals with the number of bits between (2³⁰+1) and 2⁴.

[0015]FIG. 2 shows a flowchart of a preferred embodiment of the present invention. The present invention comprises mainly the following steps.

[0016] An input signal 20 with clock 0: The selected signal of a multiplexer 22 is a signal outputted from the input signal 20. The number of bits of the input signal 20 is between 2³+1 and 2⁴. A controllable shifter 24 judges the shifting bits to right-shift the output signal of the selected signal of the multiplexer 22 two bits. An adder 26 adds the output signal shifted the judged number of bits by the controllable shifter 24 and the output signal of the selected signal of the multiplexer 22.

[0017] The input signal 20 with clock 1: The selected signal of the multiplexer 22 is the added output signal of the adder 26. The controllable shifter 24 judges the shifting bits to right-shift the output signal of the selected signal of the multiplexer 22 four bits. The adder 26 adds the output signal shifted the judged number of bits by the controllable shifter 24 and the output signal of the selected signal of the multiplexer 22.

[0018] The input signal 20 with clock 2: The selected signal of the multiplexer 22 is the added output signal of the adder 26. The controllable shifter 24 judges the shifting bits to right-shift the output signal of the selected signal of the multiplexer 22 eight bits. The adder 26 adds the output signal shifted the judged number of bits by the controllable shifter 24 and the output signal of the selected signal of the multiplexer 22.

[0019] An input signal 20 with clock 3: The selected signal of the multiplexer 22 is the added output signal of the adder 26. The controllable shifter 24 judges the shifting bits to right-shift the output signal of the selected signal of the multiplexer 22 two bits, and then outputs to an output signal 28.

[0020] Scaling factor of horizontal scan of a scanner can thus be achieved without the need of a divider and a ROM occupying a too large area in the prior art, thereby effectively decreasing the occupied area of the device, simplifying the manufacturing process, increasing the scanning speed, and enhancing the image quality of the scanner.

[0021]FIG. 3 shows a block diagram of another preferred embodiment of the present invention. In this embodiment, a digital signal is transferred to a first adder 102 and a first shifter 104 via an input signal 100. The number of bits of the digital signal is between 2³+1 and 2⁴. The first shifter 104 is connected to the first adder 102 via conducting wires. The first adder 102 is then connected to a second adder 106 and a second shifter 108 via conducting wires. The second shifter 108 is connected to the second adder 106 via conducting wires. Next, the second adder 106 is connected to a third adder 110 and a third shifter 112 via conducting wires. The third shifter 112 is connected to the third adder 110 via conducting wires. Subsequently, the third adder 110 is connected to a fourth shifter 114 via conducting wires. Finally, the fourth shifter 114 is connected to an output signal 116.

[0022]FIG. 4 shows a flowchart of another preferred embodiment of the present invention. The present invention comprises mainly the following steps.

[0023] First, an input signal 200 outputs signals to a first adder 204 for addition and a first shifter 202 to be right-shifted 2 bits. The number of bits of the input signal 200 is between 2³+1 and 2⁴. After the first shifter 202 right-shifts 2 bits, the output signal is transferred to the first adder 204 for addition.

[0024] The first adder 204 adds the input signal 200 and the output signal right-shifted 2 bits by the first shifter 202, and outputs the output signal to a second adder 208 for addition and a second shifter 206 to be right-shifted 4 bits. After the second shifter 206 right-shifts 4 bits, the output signal is transferred to the second adder 208 for addition.

[0025] The second adder 208 adds the output signal of the first adder 204 and the output signal right-shifted 4 bits by the second shifter 206, and outputs the output signal to a third adder 212 for addition and a third shifter 210 to be right-shifted 8 bits. After the third shifter 210 right-shifts 8 bits, the output signal is transferred to the third adder 212 for addition.

[0026] The third adder 212 adds the output signal of the second adder 208 and the output signal right-shifted 8 bits by the third shifter 210, and outputs the output signal to a fourth shifter 214 to be right-shifted 2 bits.

[0027] After the fourth shifter 214 right-shifts 2 bits, the output signal is transferred to an output signal 216.

[0028] Scaling factor of ⅓ of horizontal scan of a scanner can thus be achieved without the disadvantage of occupying a too large area by the device in the prior art. Because all the above four shifters are fixed right-shift type, there can be no logical gates in practice. Therefore, the device will not occupy a too large area, and the cost will not be increased. Additionally, the two inputs of each of the above three adders are related. For instance, one input (input 1) of the first adder is A, the other input (input 2) thereof will be ¼ A. Adders having inputs thus related can be much simplified. The area thus will not be enlarged. Another advantage of this method is that when a faster latency is required, or there is no pipeline architecture, this method can also be used to achieve the scaling factor of ⅓ of horizontal scan of a scanner.

[0029] The above two manufacturing methods in FIGS. 2 and 4 can be used to achieve the scaling factor of ⅓ of horizontal scan of a scanner. The principle is as follows with a signal A of 16 bits as an example.

[0030] Right-shifting n bits represents dividing a signal by 2^(n). Therefore, FIG. 2 and FIG. 4 are functions for calculating (A+A/2²)·(1+1/2⁴)·(1+1/2⁸)·1/2². $\begin{matrix} {\left( {A + {A/2^{2}}} \right) \cdot \left( {1 + {1/2^{4}}} \right) \cdot \left( {1 + {1/2^{8}}} \right) \cdot {1/2^{2}}} \\ {= {A \cdot {1/2^{2}} \cdot \left( {1 + {1/2^{2}}} \right) \cdot \left( {1 + {1/2^{4}}} \right) \cdot \left( {1 + {1/2^{8}}} \right)}} \\ {= {{A/4} \cdot \left( {1 + {1/2^{2}} + {1/2^{4}} + {1/2^{6}} + {1/2^{8}} + {1/2^{10}} + {1/2^{12}} + {1/2^{14}}} \right)}} \\ {= {{{A/4} \cdot \left( {1 + {1/2^{2}} + {1/2^{4}} + {1/2^{6}} + {1/2^{8}} + {1/2^{10}} + {1/2^{12}} + {1/2^{14}} + {1/2^{16}} + {1/2^{18}} + \ldots}\quad \right)}\left( {{A/2^{n}} = {{0\quad {if}\quad n} \geq \quad 16}} \right)}} \\ {\quad {= {{1/3}A}}{~~~~~~}} \end{matrix}$

[0031] Thus, the above two methods are used to achieve the scaling factor of ⅓ of horizontal scan of a scanner. Said embodiments use the device composed of single adder and shifter or composed of three adders and four shifters to achieving the function of calculating the scaling factor of horizontal scan. Furthermore, the present invention could also use at least an adder and a shifter to achieving the function of calculating the scaling factor of horizontal scan. In other word, if only it uses the technology principle of the present invention, it would belong to the embodiments of the invention that no matter how many the adder and the shifter are used. Said embodiments are intended to be embraced within the scope of the invention as defined in the appended claims.

[0032] To sum up, the present invention relates to a scanner and, more particularly, to a device applied to scaling factor of horizontal scan of a scanner and a method thereof. The present invention can reduce the occupied area, increase the scanning speed, and enhance the image quality of the scanner.

[0033] Although the present invention has been described with reference to the preferred embodiment thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have been suggested in the foregoing description, and other will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims. 

I claim:
 1. A device applied to scaling factor of horizontal scan of a scanner, comprising mainly: an input conducting wire situated at the foremost end of a scanner and used as an input end of signal; an addition device connected to said input conducting wire; a shifting device with one end thereof connected to said input conducting wire and the other end thereof connected to said addition device; and a shifter with one end thereof connected to said addition device and the other end thereof connected to an output conducting wire.
 2. The device as claimed in claim 1, wherein said shifting device is formed by winding conducting wires.
 3. The device as claimed in claim 2, wherein said shifting device is a bus shifting circuit formed of logical gates.
 4. The device as claimed in claim 1, wherein said shifting device comprises at least (log₂n) shifters, n being at least 2^(i) more than the number of bits of signal and i being an integer.
 5. The device as claimed in claim 1, wherein said addition device comprises at least (log₂n−1) adders, n being at least 2^(i) more than the number of bits of signal and i being an integer.
 6. The device as claimed in claim 1, wherein said input conducting wire and said output conducting wire are used to input and output signals, respectively.
 7. A method applied to scaling factor of horizontal scan of a scanner, comprising mainly the steps of: transferring an input signal to an addition device and a shifting device, right-shifting said input signal n bits and then transferring to said addition device by said shifting device; adding said input signal and an output signal of said shifting device by said addition device; and right-shifting an output signal of said addition signal 2 bits and then outputting the result by said shifting device.
 8. The method as claimed in claim 7, wherein a (log₂n−1)th adder of said addition device adds an output signal of a (log₂n−2)th adder and an output signal of a (log₂n−1)th shifter, and then outputs an output signal to a (log₂n)th shifter.
 9. The method as claimed in claim 8, wherein the value of n is at least 2^(i) more than the number of bits of signal, i being an integer.
 10. The method as claimed in claim 7, wherein a (log₂n)th shifter of said shifting device right-shifts an output signal of a (log₂n−1)th adder t bits, and then outputs the result.
 11. The method as claimed in claim 10, wherein the value of n is at least 2^(i) more than the number of bits of signal, i and t being integers.
 12. A device applied to scaling factor of horizontal scan of a scanner, comprising mainly: an input conducting wire situated at the foremost end of a scanner and used as an input end of signal; at least an adder connected to said input conducting wire; at least a shifter with one end thereof connected to said input conducting wire and the other end thereof connected to said adder; and a end shifter with one end thereof connected to said adder and the other end thereof connected to an output conducting wire.
 13. The device as claimed in claim 12, wherein said shifter is formed by routing wires.
 14. The device as claimed in claim 12, wherein said shifter is a bus shifting circuit formed of logical gates.
 15. The device as claimed in claim 12, wherein said input conducting wire and said output conducting wire are used to input and output signals, respectively. 